package com.aop;

import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;
import org.springframework.stereotype.Component;

/**
 * Created by Administrator on 2016/9/22.
 */
@Component
public class GreetingAroundAdvice implements MethodInterceptor  {
    @Override
    public Object invoke(MethodInvocation methodInvocation) throws Throwable {
        befor();
        Object result = methodInvocation.proceed();
        after();
        return result;
    }

    private void befor(){
        System.out.println("befor");
    }
    private void after(){
        System.out.println("after");
    }
}
